package com.qbw.app.module.vehicle.holder;

import android.content.Context;
import android.view.ViewGroup;

import com.qbw.app.R;
import com.qbw.app.databinding.VehicleHolderNotificationVehicleItemBinding;
import com.qbw.app.model.Vehicle;
import com.qbw.app.module.common.holder.CommonHolder;
import com.qbw.app.module.vehicle.activity.VehicleNotificationSettingActivity;

/**
 * @author QBW
 * @date 2019-10-03
 */
public class VehicleNotificationVehicleItemHolder extends CommonHolder<Vehicle, VehicleHolderNotificationVehicleItemBinding> {

    public VehicleNotificationVehicleItemHolder(Context context, ViewGroup viewParent) {
        super(context, R.layout.vehicle_holder_notification_vehicle_item, viewParent);
    }

    @Override
    public void bindData(int position, Vehicle data) {
        super.bindData(position, data);
        mBinding.setVehicle(data);
        mBinding.executePendingBindings();
        itemView.setOnClickListener(mClickListenerItem);
    }

    @Override
    protected void onClickItem() {
        VehicleNotificationSettingActivity.start(mContext, mData);
    }
}
